/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package GUI.Index;

/**
 *
 * @author Nguyen Phi Hung
 */
public class Quanlythamso extends javax.swing.JFrame {
    private boolean coutmouseclicked = false;
    /**
     * Creates new form Quanlythamso
     */
    public Quanlythamso() {
        initComponents();
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {
        bindingGroup = new org.jdesktop.beansbinding.BindingGroup();

        btn_MacDinh = new javax.swing.JButton();
        btn_Capnhat = new javax.swing.JButton();
        btn_Quaylai = new javax.swing.JButton();
        jLabel5 = new javax.swing.JLabel();
        jLabel6 = new javax.swing.JLabel();
        jLabel7 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        jLabel1 = new javax.swing.JLabel();
        txt_Sotienguitoithieu = new javax.swing.JTextField();
        txt_Sotienguithemtoithieu = new javax.swing.JTextField();
        txt_Thoigianguitoithieu = new javax.swing.JTextField();
        txt_Thoigianbatdautinhlai = new javax.swing.JTextField();

        setTitle("Quản lý tham số");
        setResizable(false);

        org.jdesktop.beansbinding.Binding binding = org.jdesktop.beansbinding.Bindings.createAutoBinding(org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, this, org.jdesktop.beansbinding.ELProperty.create("${defaultCloseOperation}"), this, org.jdesktop.beansbinding.BeanProperty.create("defaultCloseOperation"));
        bindingGroup.addBinding(binding);

        btn_MacDinh.setText("Mặc định");
        btn_MacDinh.setName("btn_MacDinh"); // NOI18N

        btn_Capnhat.setText("Chỉnh sửa");
        btn_Capnhat.setName("btn_Capnhat"); // NOI18N
        btn_Capnhat.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                btn_CapnhatMouseClicked(evt);
            }
        });

        btn_Quaylai.setText("Quay lại");
        btn_Quaylai.setName("btn_Quaylai"); // NOI18N
        btn_Quaylai.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                btn_QuaylaiMouseClicked(evt);
            }
        });

        jLabel5.setText("Ghi chú:");
        jLabel5.setName("jLabel5"); // NOI18N

        jLabel6.setText("- Thời gian gửi tối thiểu: Chỉ áp dụng cho loại tiết kiệm không kỳ hạn");
        jLabel6.setName("jLabel6"); // NOI18N

        jLabel7.setText("- Thời gian bắt đầu tính lãi: Chỉ áp dụng cho loại tiết kiệm có kỳ hạn");
        jLabel7.setName("jLabel7"); // NOI18N

        jLabel4.setText("Thời gian bắt đầu tính lãi:");
        jLabel4.setName("jLabel4"); // NOI18N

        jLabel3.setText("Thời gian gửi tối thiểu:");
        jLabel3.setName("jLabel3"); // NOI18N

        jLabel2.setText("Số tiền gửi thêm tối thiểu:");
        jLabel2.setName("jLabel2"); // NOI18N

        jLabel1.setText("Số tiền gửi tối thiểu:");
        jLabel1.setName("jLabel1"); // NOI18N

        txt_Sotienguitoithieu.setEnabled(false);
        txt_Sotienguitoithieu.setName("txt_Sotienguitoithieu"); // NOI18N

        txt_Sotienguithemtoithieu.setEnabled(false);
        txt_Sotienguithemtoithieu.setName("txt_Sotienguithemtoithieu"); // NOI18N

        txt_Thoigianguitoithieu.setEnabled(false);
        txt_Thoigianguitoithieu.setName("txt_Thoigianguitoithieu"); // NOI18N

        txt_Thoigianbatdautinhlai.setEnabled(false);
        txt_Thoigianbatdautinhlai.setName("txt_Thoigianbatdautinhlai"); // NOI18N

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addGroup(layout.createSequentialGroup()
                        .addGap(22, 22, 22)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(layout.createSequentialGroup()
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jLabel1)
                                    .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 121, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jLabel4)
                                    .addComponent(jLabel2))
                                .addGap(18, 18, 18)
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                    .addComponent(txt_Sotienguitoithieu, javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(txt_Sotienguithemtoithieu, javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(txt_Thoigianguitoithieu, javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(txt_Thoigianbatdautinhlai, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 159, Short.MAX_VALUE)))
                            .addComponent(jLabel7, javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jLabel6)))
                    .addGroup(layout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, 301, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(btn_MacDinh)
                        .addGap(56, 56, 56)
                        .addComponent(btn_Capnhat)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(btn_Quaylai)))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel1)
                    .addComponent(txt_Sotienguitoithieu, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel2)
                    .addComponent(txt_Sotienguithemtoithieu, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel3)
                    .addComponent(txt_Thoigianguitoithieu, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel4)
                    .addComponent(txt_Thoigianbatdautinhlai, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jLabel5)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel6)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel7)
                .addGap(18, 18, 18)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(btn_Quaylai)
                    .addComponent(btn_Capnhat)
                    .addComponent(btn_MacDinh))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        bindingGroup.bind();

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void btn_QuaylaiMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_btn_QuaylaiMouseClicked
        // TODO add your handling code here:
        this.dispose();
    }//GEN-LAST:event_btn_QuaylaiMouseClicked

    private void btn_CapnhatMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_btn_CapnhatMouseClicked
        // TODO add your handling code here:
        if(coutmouseclicked == true)
            coutmouseclicked = false;
        else
            coutmouseclicked = true;
        
        btn_capnhat();
    }//GEN-LAST:event_btn_CapnhatMouseClicked
    
    public void btn_capnhat() {
        if(coutmouseclicked == true)
        {
            this.txt_Sotienguithemtoithieu.setEnabled(true);
            this.txt_Sotienguitoithieu.setEnabled(true);
            this.txt_Thoigianbatdautinhlai.setEnabled(true);
            this.txt_Thoigianguitoithieu.setEnabled(true);
            this.btn_Capnhat.setText("Cập nhật");
        } else {
            this.txt_Sotienguithemtoithieu.setEnabled(false);
            this.txt_Sotienguitoithieu.setEnabled(false);
            this.txt_Thoigianbatdautinhlai.setEnabled(false);
            this.txt_Thoigianguitoithieu.setEnabled(false);
            this.btn_Capnhat.setText("Chỉnh sửa");
        }
        
    }
    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(Quanlythamso.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(Quanlythamso.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(Quanlythamso.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(Quanlythamso.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new Quanlythamso().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btn_Capnhat;
    private javax.swing.JButton btn_MacDinh;
    private javax.swing.JButton btn_Quaylai;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JTextField txt_Sotienguithemtoithieu;
    private javax.swing.JTextField txt_Sotienguitoithieu;
    private javax.swing.JTextField txt_Thoigianbatdautinhlai;
    private javax.swing.JTextField txt_Thoigianguitoithieu;
    private org.jdesktop.beansbinding.BindingGroup bindingGroup;
    // End of variables declaration//GEN-END:variables
}
